Fix RuntimeError of loading model with external tensor#6119
Fix RuntimeError of loading model with external tensor#6119jcwchen merged 1 commit intomicrosoft:masterfrom
Conversation
|
All updated. Thank you for the review and this PR is ready. |
onnxruntime/core/graph/graph.cc
Outdated
There was a problem hiding this comment.
https://github.com/onnx/onnx/blob/bd2ff65b775580d21ab38cb655a04854c348ff49/onnx/checker.cc#L133
It is required here because the code in ONNX does not handle path join...
There was a problem hiding this comment.
Then onnx should fix it! It is always safe to add an additional path separator there when you do path join. But, it seems a little bit wired to do it here without knowing the result will only be used in path join.
There was a problem hiding this comment.
And instead of calling std::ifstream, it should use fstat to test if a file exists: https://linux.die.net/man/2/fstat
There was a problem hiding this comment.
Makes sense. I am proposing a PR in ONNX to fix it before checking this PR in. Thank you for bringing this up.
There was a problem hiding this comment.
Here is the PR to fix that in ONNX: onnx/onnx#3214
|
A path join fix has been merged in ONNX: onnx/onnx#3214. Then this PR would be easier. Set the model directory without giving the separator and update ONNX commit. This PR is ready for review. Thanks. |
Description:
Motivation and Context
onnx/onnx#3157
Reload and save the onnx model with external data format will cause runtime error: